﻿using System;
using System.Linq;

namespace _124_求序列中元素的平方根并按顺序排列_LINQ语法
{
    class Program
    {
        static void Main(string[] args)
        {

            double[] 数组={ 17.5d,42.33d,100d,130d,256d,312.14d,96.56d};
            var q = from x in 数组
                    let s = Math.Sqrt(x)
                    orderby s descending
                    select (x, s);

            foreach (var n in q)
            {
                Console.WriteLine("{0,-10}->{1,-16}", n.x, n.s);

            }

        }
    }
}
